package com.sq.partner.manager.service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.ui.ModelMap;

import com.sq.partner.manager.common.Result;
import com.sq.partner.manager.mybatis.model.CommamtFee;
import com.sq.partner.manager.mybatis.model.DictDto;
import com.sq.partner.manager.mybatis.model.FacadePayment;
import com.sq.partner.manager.mybatis.model.GatewayUser;
import com.sq.partner.manager.mybatis.model.OutboundCardApply;
import com.sq.partner.manager.util.Page;

/**
 * 卡单出库申请service
 * 
 * SQ
 *
 */
public interface OutboundCardApplyService {
    /**
     * 查询多条出库申请信息 根据条件 带分页
     * 
     * @return
     * @throws Exception
     */
    public Page<OutboundCardApply> queryOutboundList(
            Page<OutboundCardApply> page) throws Exception;

    public Page<OutboundCardApply> queryCardInfoByCommamtId(
            Page<OutboundCardApply> page) throws Exception;

    public Result queryCountMax(HashMap<String, Object> map) throws Exception;

    /**
     * 查询出单页面的卡单信息 根据条件 带分页
     * 
     * @return
     * @throws Exception
     */
    public Page<OutboundCardApply> outboundAppliedList(
            Page<OutboundCardApply> page) throws Exception;

    /**
     * 查询投保方案信息
     * 
     * @return
     * @throws Exception
     */
    // public Result queryCardPlanList(String name, String channelCode) throws
    // Exception;
    public Map<String,Object> queryCardPlan(String planNo) throws Exception;

    /**
     * 加载此出单机构下业务员信息
     * 
     * @return
     * @throws Exception
     */
    public List<Map<String, Object>> loadSalesMenData(String deptNo,
            String planNo, String partnerNo) throws Exception;

    public Result saveAgentRelaCardInfo(String name, String cardNo,
            String status, String count, String deptNo, String planNo,
            CommamtFee commamtFee) throws Exception;

    /**
     * 查询申请出库记录 根据条件 带分页
     * 
     * @return
     * @throws Exception
     */
    public Page<CommamtFee> queryCommamtFeeList(Page<CommamtFee> page)
            throws Exception;

    /**
     * 缴费确认
     * 
     * @param commamtId
     * @param isPay
     * @return
     * @throws Exception
     */
    public Result doConfirm(String commamtId, String isPay) throws Exception;

    /**
     * 撤销出库
     * 
     * @param commamtId
     * @param isPay
     * @return
     * @throws Exception
     */
    public Result doCancel(String commamtId, String isPay)
            throws Exception;

    /**
     * 取得打印内容
     * 
     * @param commamtId
     * @return
     * @throws Exception
     */
    public Result queryPremamtAndAgentFee(GatewayUser gatewayuser,
            String commamtId) throws Exception;

    /**
     * 加载数据字典信息
     * 
     * @return
     * @throws Exception
     */
    public void loadDictData(ModelMap modelMap) throws Exception;

    /**
     * 归属渠道-渠道类型-新业务来源处理(根据codeType和上级code从数据字典中查询下级级联信息)
     * 
     * @param dict
     * @return
     * @throws Exception
     */
    public List<DictDto> loadSubCascadeList(DictDto dict) throws Exception;

    /**
     * 根据归属机构代码(即出单机构)获取业务员List及团队List
     * 
     * @param deptNo
     * @return
     * @throws Exception
     */
    public Result querySauserAndTeamInfo(String deptNoD) throws Exception;

    /**
     * 查询服务代码信息(从销管获取)
     * 
     * @param deptNo
     * @param newBsnsType
     * @param channleCode_QD
     * @param empNo
     * @param agentNo
     * @return
     * @throws Exception
     */
    public Result queryServiceNo(String deptNo, String newBsnsType,
            String channleCode_QD, String empNo, String agentNo)
            throws Exception;

    /**
     * 查询中介-协议信息(从销管获取)
     * 
     * @param comCode
     * @param teamCode
     * @param businessSource
     * @param channelName
     * @param prodCode
     * @return
     * @throws Exception
     */
    public Result queryAgentAndAgreeInfo(String comCode, String teamCode,
            String businessSource, String channelName, String prodCode)
            throws Exception;
	
	public CommamtFee queryForPay(String commamtId)throws Exception;
	/**
	 * 出库支付支付前保存支付信息
	 * @param tp
	 * @param userCode
	 * @return
	 * @throws Exception
	 */
	public FacadePayment saveFacadePayment(CommamtFee commamtFee,GatewayUser gatewayuser) throws Exception;
	/**
	 * 获取支付信息
	 * @param payid
	 * @return
	 * @throws Exception
	 */
	public FacadePayment getFacadePaymentByTransNo(String transNo) throws Exception;
	/**
	 * 更新支付信息
	 * @param payment
	 * @return
	 * @throws Exception
	 */
	public boolean updateFacadePayMent(FacadePayment payment) throws Exception;
	/**
	 * 根据条件查询payment信息
	 * @param map
	 * @return
	 * @throws Exception
	 */
	public FacadePayment queryPayment(HashMap<String,String> map) throws Exception;
}
